﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OracleClient;
using NewDDSys.IDAL;
using NewDDSys.Entity;
using NewDDSys.Utility;
using System.Text;

namespace NewDDSys.ORADAL
{
    public class JbDAL:IJbDAL
    {
        public int AddJb(JbInfo jb)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":num", OracleType.VarChar, jb.Num),
                DALHelper.MakeInParam(":ku", OracleType.VarChar, jb.Ku),
                DALHelper.MakeInParam(":jday", OracleType.VarChar, jb.Jday),
                DALHelper.MakeInParam(":banbie", OracleType.VarChar, jb.Banbie),
                DALHelper.MakeInParam(":banzu", OracleType.VarChar, jb.Banzu),
                DALHelper.MakeInParam(":tianbao", OracleType.VarChar, jb.Tianbao),
                DALHelper.MakeInParam(":shebei", OracleType.VarChar, jb.Shebei),
                DALHelper.MakeInParam(":yanxu", OracleType.VarChar, jb.Yanxu)
            };
            return (DALHelper.RunCommand(@"insert into dd.JB (num, ku, jday, banbie, banzu, tianbao, shebei, yanxu) values (:num, :ku, to_date(:jday,'yyyy-mm-dd hh24:mi:ss'), :banbie, :banzu, :tianbao, :shebei, :yanxu)", prams));
        }
        public int UpdateJb(string num, string shebei, string yanxu, string info)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":num", OracleType.VarChar, num),
                DALHelper.MakeInParam(":shebei", OracleType.VarChar, shebei),
                DALHelper.MakeInParam(":yanxu", OracleType.VarChar, yanxu),
                DALHelper.MakeInParam(":info", OracleType.VarChar, info)
            };
            return (DALHelper.RunCommand(@"update dd.JB set shebei = :shebei, yanxu = :yanxu, info = :info where num = :num", prams));
        }

        
        public int Del(string num)
        {
            OracleParameter[] prams = {
                
                DALHelper.MakeInParam(":num", OracleType.VarChar, num)                      
            };
            return (DALHelper.RunCommand(@"delete from dd.JB where NUM = :num", prams));
        }
        public DataSet Select(string num)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":num", OracleType.VarChar, num)
            };
            return (DALHelper.RunProcReturn(@"select * from dd.JB where NUM = :num", prams, "Sbynum"));
        }

        public DataSet SelectByDay(string sday, string ku)
        {
            string bday = sday + "00:00:00";
            string eday = sday + "23:59:59";
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bday", OracleType.VarChar, bday),
                DALHelper.MakeInParam(":eday", OracleType.VarChar, eday),
                DALHelper.MakeInParam(":ku", OracleType.VarChar, ku)
            };

            return (DALHelper.RunProcReturn(@"select * from dd.JB where jday >= to_date(:bday,'yyyy-mm-dd hh24:mi:ss') and jday <= to_date(:eday,'yyyy-mm-dd hh24:mi:ss') and ku = :ku order by jday desc", prams, "Sbyday"));
        
        }
        public string banbieNow()
        {
            object obj = DALHelper.ExecuteSQLScalar(@"select banbie from (select banbie from dd.JB order by jday desc) where rownum < 2");
            return obj.ToString();
        }
        public DataSet jbsy(string ku)
        {
            string cday = DateTime.Now.ToShortDateString().ToString();
            string banbie = "";
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            if (DateTime.Compare(dt1, dt2) < 0 || DateTime.Compare(dt1, dt3) > 0)
            {
                banbie = "夜";
            }
            else
                banbie = "白";
            string bt = "";
            string et = "";
            switch (banbie)
            {
                case "白":
                    {
                        bt = cday + "08:00:00";
                        et = Convert.ToDateTime(cday).AddHours(20).ToString();
                    }
                    break;
                case "夜":
                    {
                        et = cday + "08:00:00";
                        bt = Convert.ToDateTime(cday).AddHours(-4).ToString();
                    }
                    break;
            }
            OracleParameter[] prams = {
                
                DALHelper.MakeInParam(":ku", OracleType.VarChar, ku),
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)      
            };

            return (DALHelper.RunProcReturn(@"select * from (select shebei, yanxu from dd.JB where ku = :ku and jday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and jday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') order by jday desc) where rownum < 2", prams, "ysqk"));
        
        }
        public string AUTOID(string ku)
        {

            string num = "";
            object time = DALHelper.ExecuteSQLScalar(@"select sysdate from dual");
            string kudm = "";
            switch (ku)
            {
                case "嘉东库":
                    kudm = "JD"; break;
                case "板材库":
                    kudm = "BC"; break;
                case "不锈钢热轧库":
                    kudm = "BXR"; break;
                case "不锈钢冷轧库":
                    kudm = "BXL"; break;
                case "碳钢热轧库":
                    kudm = "TR"; break;
                case "碳钢冷轧库":
                    kudm = "TL"; break;
                case "一高线":
                    kudm = "1G"; break;
                case "二高线":
                    kudm = "2G"; break;
                case "大棒线":
                    kudm = "DB"; break;
                case "四轧库":
                    kudm = "SZ"; break;
                case "酸洗库":
                    kudm = "SX"; break;
                case "化产库":
                    kudm = "HC"; break;
                default:
                    break;
            }
            num = "jb" + kudm + time.ToString();


            return num;
        }
        
        public int UpdateXG(string num, string xg)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":num", OracleType.VarChar, num),
                DALHelper.MakeInParam(":xg", OracleType.VarChar, xg)
            };
            return (DALHelper.RunCommand(@"update dd.JB set xgday = to_date(:xg,'yyyy-mm-dd hh24:mi:ss') where num = :num", prams));
        }
        public int UpdateInfo(string num, string info)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":num", OracleType.VarChar, num),
                DALHelper.MakeInParam(":info", OracleType.VarChar, info)
            };
            return (DALHelper.RunCommand(@"update dd.JB set info = :info where num = :num", prams));
        }
        public DataSet SelectJb(string ku)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":ku", OracleType.VarChar, ku)
            };
            return (DALHelper.RunProcReturn(@"select * from (select num, shebei, yanxu, info from dd.JB where ku = :ku order by jday desc) where rownum < 2", prams, "jb"));
        }
        public string JDXC()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dk) from dd.XKCDT where kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams);
            return obj.ToString();
        }
        public string JDXCL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dk) from dd.XKCDT where kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams);
            return obj.ToString();
        }
        public string JDBC()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dk) from dd.BKCDT where kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams);
            return obj.ToString();
        }
        public string JDBCL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dk) from dd.BKCDT where kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams);
            return obj.ToString();
        }
        public string JDZB()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dk) from dd.ZKCDT where kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams);
            return obj.ToString();
        }
        public string JDZBL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dk) from dd.ZKCDT where kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams);
            return obj.ToString();
        }
        public string JDTGR()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢热轧库'", prams);
            return obj.ToString();
        }
        public string JDTGRL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢热轧库'", prams);
            return obj.ToString();
        }

        public string JDTGL()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk) from dd.LKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢冷轧库'", prams);
            return obj.ToString();
        }
        public string JDTGLL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk) from dd.LKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢冷轧库'", prams);
            return obj.ToString();
        }
        public string JDTGRH()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk - dt.dkwj - dt.dkkl) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢热轧库'", prams);
            return obj.ToString();
        }
        public string JDTGRHL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk - dt.dkwj - dt.dkkl) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢热轧库'", prams);
            return obj.ToString();
        }
        public string JDTGLH()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk - dt.dkwj) from dd.LKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢冷轧库'", prams);
            return obj.ToString();
        }
        public string JDTGLHL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk - dt.dkwj) from dd.LKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢冷轧库'", prams);
            return obj.ToString();
        }
        public string JDTGRK()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dkkl) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢热轧库'", prams);
            return obj.ToString();
        }
        public string JDTGRKL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dkkl) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢热轧库'", prams);
            return obj.ToString();
        }
        public string JDTGRW()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dkwj) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢热轧库'", prams);
            return obj.ToString();
        }
        public string JDTGRWL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dkwj) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢热轧库'", prams);
            return obj.ToString();
        }
        public string JDTGLW()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dkwj) from dd.LKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢冷轧库'", prams);
            return obj.ToString();
        }
        public string JDTGLWL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dkwj) from dd.LKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '碳钢冷轧库'", prams);
            return obj.ToString();
        }
        public string JDBXR()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '不锈钢热轧库'", prams);
            return obj.ToString();
        }
        public string JDBXRL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '不锈钢热轧库'", prams);
            return obj.ToString();
        }
        public string JDBXL()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk) from dd.LKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '不锈钢冷轧库'", prams);
            return obj.ToString();
        }
        public string JDBXLL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk) from dd.LKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '不锈钢冷轧库'", prams);
            return obj.ToString();
        }
        public string JDBXRH()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk - dt.dkwj - dt.dkkl) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '不锈钢热轧库'", prams);
            return obj.ToString();
        }
        public string JDBXRHL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk - dt.dkwj - dt.dkkl) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '不锈钢热轧库'", prams);
            return obj.ToString();
        }
        public string JDBXLH()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk - dt.dkwj) from dd.LKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '不锈钢冷轧库'", prams);
            return obj.ToString();
        }
        public string JDBXLHL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dk - dt.dkwj) from dd.LKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '不锈钢冷轧库'", prams);
            return obj.ToString();
        }
        public string JDBXRK()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dkkl) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '不锈钢热轧库'", prams);
            return obj.ToString();
        }
        public string JDBXRKL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.dkkl) from dd.RKCDT dt, dd.KC jg where dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss') and jg.num = dt.num and jg.ku = '不锈钢热轧库'", prams);
            return obj.ToString();
        }
        public DataSet ZBKC()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            return (DALHelper.RunProcReturn(@"select sum(kn) as zbkc, sum(kn - kndc - knkl - knwj) as zbhg, sum(knwj) as zbwj from dd.ZKCDT where kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams, "zbkc"));

        }
        public DataSet ZBKCL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            return (DALHelper.RunProcReturn(@"select sum(kn) as zbkc, sum(kn - kndc - knkl - knwj) as zbhg, sum(knwj) as zbwj from dd.ZKCDT where kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams, "zbkc"));

        }
        public string XCKC(string ku)
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et),
                DALHelper.MakeInParam(":ku", OracleType.VarChar, ku)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.kn) from dd.XKCDT dt, dd.KC jg where jg.ku = :ku and jg.num = dt.num and dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams);
            return obj.ToString();
        }
        public string XCKCL(string ku, string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et),
                DALHelper.MakeInParam(":ku", OracleType.VarChar, ku)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.kn) from dd.XKCDT dt, dd.KC jg where jg.ku = :ku and jg.num = dt.num and dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams);
            return obj.ToString();
        }
        public string BCKC(string ku)
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et),
                DALHelper.MakeInParam(":ku", OracleType.VarChar, ku)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.kn) from dd.BKCDT dt, dd.KC jg where jg.ku = :ku and jg.num = dt.num and dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams);
            return obj.ToString();
        }
        public string BCKCL(string ku, string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et),
                DALHelper.MakeInParam(":ku", OracleType.VarChar, ku)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.kn) from dd.BKCDT dt, dd.KC jg where jg.ku = :ku and jg.num = dt.num and dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams);
            return obj.ToString();
        }
        public string SXKC()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.kn) from dd.RKCDT dt, dd.KC jg where jg.ku = '酸洗库' and jg.num = dt.num and dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams);
            return obj.ToString();
        }
        public string SXKCL(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            object obj = DALHelper.ExecuteSQLScalar(@"select sum(dt.kn) from dd.RKCDT dt, dd.KC jg where jg.ku = '酸洗库' and jg.num = dt.num and dt.kday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and dt.kday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams);
            return obj.ToString();
        }
        public DataSet JBSB()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            return (DALHelper.RunProcReturn(@"select ku, banbie, shebei from dd.JB where jday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and jday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams, "jbsb"));

        }
        public DataSet JBSBH(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            return (DALHelper.RunProcReturn(@"select ku, banbie, shebei from dd.JB where jday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and jday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams, "jbsb"));

        }
        public DataSet JBYX()
        {
            string nowtime = DateTime.Now.ToShortTimeString().ToString();
            string time1 = "08:00:00";
            string time2 = "20:00:00";
            DateTime dt1 = Convert.ToDateTime(nowtime);
            DateTime dt2 = Convert.ToDateTime(time1);
            DateTime dt3 = Convert.ToDateTime(time2);
            string bt = "";
            string et = "";
            if (DateTime.Compare(dt1, dt2) >= 0 && DateTime.Compare(dt1, dt3) <= 0)
            {
                bt = dt2.ToString();
                et = dt3.ToString();
            }
            else if (DateTime.Compare(dt1, dt2) < 0)
            {
                bt = dt3.AddDays(-1).ToString();
                et = dt1.ToString();
            }
            else
            {
                bt = dt3.ToString();
                et = dt1.ToString();
            }
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            return (DALHelper.RunProcReturn(@"select ku, banbie, yanxu from dd.JB where jday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and jday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams, "jbsb"));

        }
        public DataSet JBYXH(string bt, string et)
        {
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            return (DALHelper.RunProcReturn(@"select ku, banbie, yanxu from dd.JB where jday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and jday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams, "jbsb"));


        }
        public DataSet JDJBInfo(string cday)
        {
            string et = Convert.ToDateTime(cday).AddHours(-4).ToString();
            string bt = Convert.ToDateTime(et).AddDays(-1).ToString();
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et)
            };
            return (DALHelper.RunProcReturn(@"select banbie, info from dd.JB where jday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and jday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams, "jbinfo"));
        }
        public DataSet JBCX(string kday, string eday, string ku)
        {
            string bt = kday + "20:00:00";
            string et = eday + "20:00:00";
            OracleParameter[] prams = {
                DALHelper.MakeInParam(":bt", OracleType.VarChar, bt),
                DALHelper.MakeInParam(":et", OracleType.VarChar, et),
                DALHelper.MakeInParam(":ku", OracleType.VarChar, ku)
            };
            return (DALHelper.RunProcReturn(@"select num, ku, jday, banbie, banzu, tianbao, shebei, yanxu, info, xgday from dd.JB where ku = :ku and jday >= to_date(:bt,'yyyy-mm-dd hh24:mi:ss') and jday <= to_date(:et,'yyyy-mm-dd hh24:mi:ss')", prams, "jbcx"));
        }
        
    }
}
